import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/label/list',
    method: 'get',
    params: query
  })
}

export function fetchLabel(id) {
  return request({
    url: '/label/detail/' + id,
    method: 'get'
  })
}

export function updateLabel(id, data) {
  return request({
    url: '/label/update/' + id,
    method: 'put',
    data
  })
}

export function addLabel(data) {
  return request({
    url: '/label/add',
    method: 'post',
    data
  })
}

export function addLabelList(data) {
  return request({
    url: '/label/add_list',
    method: 'post',
    data
  })
}

export function deleteLabel(id) {
  return request({
    url: `/label/delete/${id}`,
    method: 'delete'
  })
}

export function bachDeleteLabel(ids) {
  return request({
    url: '/label/batch_delete/' + ids,
    method: 'get'
  })
}

export function brushLabel(data) {
  return request({
    url: '/label/brush',
    method: 'post',
    data
  })
}
